<template>
  <view class="bg-f6">
    <u-navbar>
      <view class="slot-wrap flex flex-jc-c flex-ai-c" @click="openSelector">
        <text class="titile">我的派工({{ selectedDate }})</text>
        <u-icon name="arrow-down" color="#333" size="32rpx"></u-icon>
      </view>
    </u-navbar>

    <view class="top-wrap">
      <view class="search-wrap">
        <u-search
          placeholder="请输入电话、车牌"
          v-model="keyword"
          maxlength="11"
          :show-action="false"
          @search="onSearch"
          bg-color="#f6f6f6"
        ></u-search>
      </view>
      <view class="tab-wrap">
        <u-tabs
          :list="tabList"
          :is-scroll="false"
          :current="currentTab"
          active-color="#FBB000"
          inactive-color="#999"
          bar-width="60"
          bar-height="8"
          height="122"
          font-size="26"
          @change="change"
        ></u-tabs>
        <view
          class="tab-tag flex flex-jc-sb flex-ai-c"
          v-if="tabList[currentTab].list"
        >
          <view
            class="tag"
            :class="
              subTab[currentTab] === index ? 'tag-actiive' : 'tag-unactive'
            "
            v-for="(item, index) in tabList[currentTab].list"
            :key="index"
            @click="changeSubTab(index)"
          >
            {{ item.name }}
          </view>
        </view>
      </view>
    </view>
    <!-- 排队中列表 -->
    <scroll-view
      v-if="dataList.length > 0"
      :class="currentTab === 0 || currentTab === 1 ? 'list-wrap' : 'list-wrap2'"
      :scroll-y="true"
      @scrolltolower="onreachBottom"
    >
      <uni-swipe-action>
        <view v-for="(item, index) in dataList" :key="index">
          <record-card
            class="content-box"
            :isDisable="currentTab !== 0"
            :info="item"
            :currentTab="currentTab"
            @refresh="refresh"
          ></record-card>
        </view>
        <view class="u-text-center">
          <u-loadmore
            v-if="dataList.length"
            :status="loadStatus[loadStatusId]"
            margin-bottom="20rpx"
            margin-top="20rpx"
          ></u-loadmore>
        </view>
      </uni-swipe-action>
    </scroll-view>

    <view
      v-else-if="showImg"
      :class="currentTab === 0 || currentTab === 1 ? 'list-wrap' : 'list-wrap2'"
    >
      <defaultImg msg="暂无订单"></defaultImg>
    </view>
    <date-selector
      :title="'选择日期'"
      :showsc="showsc"
      @confirmTime="confirmsc"
      @closeTime="closeTime"
    ></date-selector>
  </view>
</template>

<script src="./arrivalRecordListOfMy.js"></script>

<style lang="scss" scoped>
@import './arrivalRecordListOfMy.scss';
</style>
